"""
Description:
Version: 2.0
Autor: zyw
Date: 2021-12-13 09:28:10
LastEditors: zyw
LastEditTime: 2022-03-03 14:15:38
"""
# 带报告的执行
import os, sys
import unittest
from unittestreport import TestRunner
from common.hand_path import case_path, report_path
base_path = os.path.abspath(os.path.join(os.getcwd(), "."))
sys.path.append(base_path)


def main():
    suite = unittest.defaultTestLoader.discover(case_path)
    runner = TestRunner(suite,
                        filename="乾坤尺接口测试.html",
                        tester='测试',
                        title='乾坤尺智慧实验室数字化平台接口测试报告',
                        report_dir=report_path)
    runner.run()
    # runner.send_email( 
    #     host='smtp.qq.com',
    #     port=465,
    #     user='1737895214@qq.com',
    #     password='tmrpydcphferdghb',
    #     to_addrs='1737895214@qq.com',
    #     is_file=True
    # )


if __name__ == '__main__':
    main()
